package patrol.mobile.com.mobilepatrol.activity.security.emergency;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.dl7.recycler.helper.RecyclerViewHelper;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;
import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.BaseActivity;
import patrol.mobile.com.mobilepatrol.activity.security.ConsTitles;
import patrol.mobile.com.mobilepatrol.activity.security.adapter.EmergencyPackageEdit2ListAdapter;
import patrol.mobile.com.mobilepatrol.utils.CommonUtil;

/**
 * Created by fuzhen.li on 2018/9/18.
 */
public class EmergencyPackageEdit2Activity extends BaseActivity {

    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    @BindView(R.id.tv_historyRecorder)
    TextView tvHistoryRecorder;
    @BindView(R.id.tv_visitRecorder)
    TextView tvVisitRecorder;
    private EmergencyPackageEdit2ListAdapter emergencyPackageEdit2ListAdapter;

    @Override
    public void initView() {
        super.initView();

    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_emergency_package_edit2;
    }

    @Override
    public void setListener() {

    }

    @Override
    public void initData() {
        super.initData();
        List<String> strings = new ArrayList<>();
        strings.add("经常");
        strings.add("年中");
        strings.add("年末");
        emergencyPackageEdit2ListAdapter = new EmergencyPackageEdit2ListAdapter(this,strings);
        RecyclerViewHelper.initRecyclerViewV(this,recyclerView,true,emergencyPackageEdit2ListAdapter);
        recyclerView.setAdapter(emergencyPackageEdit2ListAdapter);
    }


    @Override
    public void initTitle() {
        iv_back.setImageResource(R.mipmap.up_white);
        iv_back.setVisibility(View.VISIBLE);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                CommonUtil.exitActivityAndBackAnim(EmergencyPackageEdit2Activity.this, true);
            }
        });
        tv_center_title.setVisibility(View.VISIBLE);
        tv_center_title.setText(ConsTitles.EMERGENCY_PACKAGE_EDIT_2);
    }


    @OnClick({R.id.tv_historyRecorder, R.id.tv_visitRecorder})
    public void onEdit2Click(View v) {

        switch (v.getId()) {

            case R.id.tv_historyRecorder:
                // startActivity(EmergencyCheck4Activity.class);
                break;
            case R.id.tv_visitRecorder:
               startActivity(EmergencyPackageEdit3Activity.class);
                break;
        }

    }
}
